﻿<%@ Page Title="" Language="C#" MasterPageFile="~/RosarioFinanzas.Master" AutoEventWireup="true"
    CodeBehind="Contactos.aspx.cs" Inherits="RosarioFinanzas.Formulario_web14" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<title>ROSARIO FINANZAS - Contactos</title>
    <link rel="stylesheet" type="text/css" href="CSS/Contactenos.css?version=2" />
        <script type="text/javascript">
            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-28485653-1']);
            _gaq.push(['_trackPageview']);

            (function () {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();

    </script>
    <script type="text/javascript">
        $(document).ready(function() {

            strfecha();
            BorrarEstiloMenuPrincipal();
            SeleccionEstilo("CONTACTENOS");

            $("#btnNewsletter").click(

                function (e) {

                    e.preventDefault();   // Evita que se recargue la web luego de terminado el método

                    if ($("#emailNewsletter").val() != "") {

                        if (isValidEmailAddress($("#emailNewsletter").val())) {

                            $.ajax({
                                type: "POST",
                                url: "Service1.asmx/InscripcionNewsletter",
                                data: "{email:'" + $("#emailNewsletter").val() + "'}",
                                contentType: "application/json; charset=utf-8",
                                async: false,
                                dataType: "json",
                                success: function (msg) {

                                    alert("Su inscripción ha sido recibida correctamente");
                                    location.reload();

                                },
                                error: function (xhr, ajaxOptions, thrownError) {
                                    alert("Hubo un error al enviar su solicitud. Por favor intentelo nuevamente o contáctenos a través de las Redes Sociales");

                                }
                            });

                        } else {
                            alert("El formato del email es inválido");
                        }

                    } else {
                        alert("El e-mail es obligatorio");
                    }
                });


        });

        function isValidEmailAddress(emailAddress) {
            var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
            return pattern.test(emailAddress);
        };
      </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
            <div id="inscripcionNewsLetter">
            <label class="titulo-Newsletter" >Inscripción al Newsletter</label>
            <table>
                <tr>
			        <td><label class="email-Newsletter" >Dejanos tu E-Mail:</label></td> 
                </tr>
                <tr>
			        <td><input type="text" id="emailNewsletter" class="input-Newsletter" name="email"/></td>
                </tr>
            </table>
            <button type="button" id="btnNewsletter" class="buttonNewsLetter">Inscribirse</button>

        </div>

        <div id="Contacto">
            <div id="titulo">
            ENVIENOS SU CONSULTA O COMENTARIO
            </div>
            <div id="Izquierda">
                <table>
                    <tr>
                        <td>
                            Nombre
                        </td>
                        <td>
                            <asp:TextBox ID="txtNombre" runat="server" CssClass=TextBusqueda></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                ControlToValidate="txtComentario" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Apellido
                        </td>
                        <td>
                            <asp:TextBox ID="txtApellido" runat="server" CssClass=TextBusqueda></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                ControlToValidate="txtComentario" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Mail
                        </td>
                        <td>
                            <asp:TextBox ID="txtMail" runat="server" CssClass=TextBusqueda Height="20px" 
                                Width="120px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                ControlToValidate="txtComentario" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Telefono
                        </td>
                        <td>
                            <asp:TextBox ID="Telefono" runat="server" CssClass="TextBusqueda"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                ControlToValidate="txtComentario" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                      <tr>
                        <td>
                            
                        </td>
                        <td>
                              <asp:LinkButton ID="btnEnviar" CssClass="bottonLink" runat="server" 
                                  onclick="btnEnviar_Click" >Enviar</asp:LinkButton>
                        </td>
                    </tr>
                    <tr>
                    <td colspan="2">
                    Deseo recibir Emails de <br> Noticias de RF! 
                        <asp:CheckBox ID="chkNewsLetter" runat="server" />
                    </td>
                    </tr>
                    <tr>
                    <td colspan="2">
                        <img id="logito" src="Imagenes/logito.jpg"  />
                    </td>
                    </tr>
                </table>
            </div>
            <div id="Derecha">
                <asp:TextBox ID="txtComentario" runat="server" CssClass="TextComentario" 
                    TextMode="MultiLine" ></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtComentario" ErrorMessage="*"></asp:RequiredFieldValidator>
            </div>
         </div>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <div >
        <span id="Fecha"></span>
    </div>
</asp:Content>